<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateWorkOrderFuyouInfoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('work_order_fuyou_info', function (Blueprint $table) {
            $table->id();
            $table->string('workOrderNo', 32)->default('')->comment('工单号');
            $table->string('fyMchntCd', 15)->default('')->comment('富友商户号');
            $table->unsignedTinyInteger('step')->default(0)->comment('步骤 0提交到富友 1富友基本信息提交失败 2图片上传失败 3附件接口请求失败 4微信子商户号查询失败 5支付宝子商户号查询失败 6修改信息失败 7微信授权验证失败 8支付宝授权验证失败');
            $table->unsignedInteger('status')->default(0)->comment('状态 0提交到富友 1成功 2失败');
            $table->json('shopImg')->nullable()->default('')->comment('店铺审核图片,json');
            $table->string('weChatAuthorizeImg', 255)->default('')->comment('微信授权二维码图片');
            $table->unsignedInteger('weChatAuthorizeStatus')->default(0)->comment('微信授权状态 0待认证 1成功 2失败');
            $table->string('alipayAuthorizeImg', 255)->default('')->comment('支付宝授权二维码图片');
            $table->unsignedInteger('alipayAuthorizeStatus')->default(0)->comment('支付宝授权状态 0待认证 1成功 2失败');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '富友商户信息表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('work_order_fuyou_info');
    }
}
